let token = uni.getStorageSync("token");

const state = {
	// 令牌
	token: token,
}


const mutations = {
	SET_TOKEN(state, val) {
		state.token = val;
		uni.setStorageSync("token", val);
	}
}

const actions = {
	// 登录
	login({
		state,
		commit,
		dispatch
	}, token) {
		commit("SET_TOKEN", token);
	}
}


export default {
	namespaced: true,
	state,
	mutations,
	actions
}
